<style type="text/css">
#functionGroup label {
	height: 23px;
	line-height: 23px;
}
#functionGroup input {
	width: auto;
	height: auto;
}
</style>
<div class="pageContent">
	<form class="pageForm required-validate">
		<div class="pageFormContent">
			<input type="hidden" name="navTabId" value="${navTabId!''}">
			<input type="hidden" name="id" value="${siteCode!''}">
			<fieldset>
				<dl>
					<dt>工厂编号：</dt>
					<dd>
						<input id="siteCode" name="siteCode" readonly="readonly" value="${factory.siteCode!''}" size="22" type="text" maxlength="20" class="required toUp"	/>
					</dd>
				</dl>
				<dl>
					<dt>工厂描述：</dt>
					<dd>
						<input id="siteText" 
						<#if type == "view">
						readonly="readonly"
						</#if>
						name="siteText" size="22" type="text" value="${factory.siteText!''}" maxlength="60" class="required" />
					</dd>
				</dl>
				<dl class="nowrap">
					<dt>&nbsp;</dt>
					<dd>
						<label>
							<input type="checkbox" id="lockFlag" value="1" 
							<#if factory.lockFlag == 1>
							checked="checked"
							</#if>
							<#if type == "view">
							disabled="disabled"
							</#if>
							/>
							锁定
						</label>
					</dd>
				</dl>
			</fieldset>
		</div>
		<#assign createInfo=factory>
		<#include "/admin/common/createInfo.html">
		<div class="formBar">
			<ul>
				<#if type == "edit">
				<li>
					<div class="buttonActive">
						<div class="buttonContent">
							<button id="submit" >保存</button>
						</div>
					</div>
				</li>
				<li>
					<div class="buttonActiveGrey">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div>
				</li>
				<#else>
				<li>
					<div class="buttonActive">
						<div class="buttonContent">
							<button type="button" class="close">关闭</button>
						</div>
					</div>
				</li>
				</#if>
			</ul>
		</div>
	</form>
</div>
<script type="text/javascript">
	$(function() {
		var $page = DWZ.context(), $form = $('form:first', $page), $submit = $('#submit', $form).on('click', function() {
			if (!$form.valid()) {
				return false;
			}
			var postData = {
				siteCode : $('#siteCode', $form).val().trim(),
				siteText : $('#siteText', $form).val().trim(),
				lockFlag : $('#lockFlag', $form)[0].checked ? 1 : 0
			};
			DWZ.ajax({
				url : hostUrl + '/management/factory/updateFactory',
				data : postData,
				success : function() {
					$('#jGridForFactory', $page.data('_parent')).jGrid('loadData');
				},
				complete : function() {
					$.pdialog.close($page);
				}
			});
			return false;
		});
	});
</script>